﻿using Sharp.DataTransferObject;
using Sharp.Infrastructure;
using Sharp.Infrastructure.Interfaces;

namespace Sharp.ServiceContracts
{
    /// <summary>
    /// OAuth 服务
    /// </summary>
    [ContractTag(Tag = ContractTagEnum.AllowAnonymous)]
    public interface IOAuthService : IApplicationServiceContract
    {
        /// <summary>
        /// 移除旧票据
        /// </summary>
        /// <param name="grantData"></param>
        /// <returns></returns>
        bool RemoveOldTicket(AuthorizationDTO grantData);
        /// <summary>
        /// 设置票据
        /// </summary>
        /// <param name="tokenValue"></param>
        /// <returns></returns>
        bool SetTicketValue(AuthorizationDTO tokenValue);
        /// <summary>
        /// 获取票据
        /// </summary>
        /// <param name="token"></param>
        /// <returns></returns>
        AuthorizationDTO GetTicketValue(string token);
    }
}